#include <iostream>
#include <signal.h>
#include <sys/types.h>
#include <string.h>
using namespace std;
int main(int argc, char* argv[])
{
    //./mykill -9 pid
    if (argc != 3)
    {
        cout << "usage:./mykill -signal pid" << endl;
        exit(0);
    }
    int sig = stoi(argv[1] + 1);
    pid_t pid = stoi(argv[2]);
    cout << "kill -" << sig << " " << pid <<endl;
    //向任意进程发送任意信号
    kill(pid, sig);
    return 0;
}